// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_SALES_APP
// * CreateDate    : 2014-06-05 18:30:35
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:35
// * LastChanger   : 2014-06-05 18:30:35
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class SalesAppEntity : EntityBase
    {
        public SalesAppTable TableSchema
        {
            get
            {
                return SalesAppTable.Current;
            }
		}
		
		public SalesAppEntity()
        {

        }
		
		public SalesAppEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
			this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
			this.UpdatedBy = Convert.ToString(CommonFunctions.ToObject(dr["UPDATED_BY"]));
			this.UpdatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["UPDATED_DATE"]));
			this.IsActive = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_ACTIVE"]));
			this.CompanyId = Convert.ToString(CommonFunctions.ToObject(dr["COMPANY_ID"]));
			this.SobId = Convert.ToString(CommonFunctions.ToObject(dr["SOB_ID"]));
			this.AppNo = Convert.ToString(CommonFunctions.ToObject(dr["APP_NO"]));
			this.Type = Convert.ToString(CommonFunctions.ToObject(dr["TYPE"]));
			this.SoNo = Convert.ToString(CommonFunctions.ToObject(dr["SO_NO"]));
			this.CustomerId = Convert.ToString(CommonFunctions.ToObject(dr["CUSTOMER_ID"]));
			this.CustomerName = Convert.ToString(CommonFunctions.ToObject(dr["CUSTOMER_NAME"]));
			this.CustomerCode = Convert.ToString(CommonFunctions.ToObject(dr["CUSTOMER_CODE"]));
			this.ContactPerson = Convert.ToString(CommonFunctions.ToObject(dr["CONTACT_PERSON"]));
			this.AppPerson = Convert.ToString(CommonFunctions.ToObject(dr["APP_PERSON"]));
			this.AppDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["APP_DATE"]));
			this.PaymentType = Convert.ToString(CommonFunctions.ToObject(dr["PAYMENT_TYPE"]));
			this.DeliveryAdd = Convert.ToString(CommonFunctions.ToObject(dr["DELIVERY_ADD"]));
			this.DeliveryPc = Convert.ToString(CommonFunctions.ToObject(dr["DELIVERY_PC"]));
			this.TrasportType = Convert.ToString(CommonFunctions.ToObject(dr["TRASPORT_TYPE"]));
			this.DeliveryType = Convert.ToString(CommonFunctions.ToObject(dr["DELIVERY_TYPE"]));
			this.TotalAmount = Convert.ToDecimal(CommonFunctions.ToObject(dr["TOTAL_AMOUNT"]));
			this.Currency = Convert.ToString(CommonFunctions.ToObject(dr["CURRENCY"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
        }
		
		public SalesAppEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
			this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
			this.UpdatedBy = Convert.ToString(CommonFunctions.ToObject(dr["UPDATED_BY"]));
			this.UpdatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["UPDATED_DATE"]));
			this.IsActive = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_ACTIVE"]));
			this.CompanyId = Convert.ToString(CommonFunctions.ToObject(dr["COMPANY_ID"]));
			this.SobId = Convert.ToString(CommonFunctions.ToObject(dr["SOB_ID"]));
			this.AppNo = Convert.ToString(CommonFunctions.ToObject(dr["APP_NO"]));
			this.Type = Convert.ToString(CommonFunctions.ToObject(dr["TYPE"]));
			this.SoNo = Convert.ToString(CommonFunctions.ToObject(dr["SO_NO"]));
			this.CustomerId = Convert.ToString(CommonFunctions.ToObject(dr["CUSTOMER_ID"]));
			this.CustomerName = Convert.ToString(CommonFunctions.ToObject(dr["CUSTOMER_NAME"]));
			this.CustomerCode = Convert.ToString(CommonFunctions.ToObject(dr["CUSTOMER_CODE"]));
			this.ContactPerson = Convert.ToString(CommonFunctions.ToObject(dr["CONTACT_PERSON"]));
			this.AppPerson = Convert.ToString(CommonFunctions.ToObject(dr["APP_PERSON"]));
			this.AppDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["APP_DATE"]));
			this.PaymentType = Convert.ToString(CommonFunctions.ToObject(dr["PAYMENT_TYPE"]));
			this.DeliveryAdd = Convert.ToString(CommonFunctions.ToObject(dr["DELIVERY_ADD"]));
			this.DeliveryPc = Convert.ToString(CommonFunctions.ToObject(dr["DELIVERY_PC"]));
			this.TrasportType = Convert.ToString(CommonFunctions.ToObject(dr["TRASPORT_TYPE"]));
			this.DeliveryType = Convert.ToString(CommonFunctions.ToObject(dr["DELIVERY_TYPE"]));
			this.TotalAmount = Convert.ToDecimal(CommonFunctions.ToObject(dr["TOTAL_AMOUNT"]));
			this.Currency = Convert.ToString(CommonFunctions.ToObject(dr["CURRENCY"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return SalesAppTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_ID)); }
            set { SetData(SalesAppTable.C_ID, value); }
        }
		
        [DataMember]
        public string CreatedBy
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_CREATED_BY)); }
            set { SetData(SalesAppTable.C_CREATED_BY, value); }
        }
		
        [DataMember]
        public DateTime CreatedDate
        {
            get { return Convert.ToDateTime(GetData(SalesAppTable.C_CREATED_DATE)); }
            set { SetData(SalesAppTable.C_CREATED_DATE, value); }
        }
		
        [DataMember]
        public string UpdatedBy
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_UPDATED_BY)); }
            set { SetData(SalesAppTable.C_UPDATED_BY, value); }
        }
		
        [DataMember]
        public DateTime UpdatedDate
        {
            get { return Convert.ToDateTime(GetData(SalesAppTable.C_UPDATED_DATE)); }
            set { SetData(SalesAppTable.C_UPDATED_DATE, value); }
        }
		
        [DataMember]
        public int IsActive
        {
            get { return Convert.ToInt32(GetData(SalesAppTable.C_IS_ACTIVE)); }
            set { SetData(SalesAppTable.C_IS_ACTIVE, value); }
        }
		
        [DataMember]
        public string CompanyId
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_COMPANY_ID)); }
            set { SetData(SalesAppTable.C_COMPANY_ID, value); }
        }
		
        [DataMember]
        public string SobId
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_SOB_ID)); }
            set { SetData(SalesAppTable.C_SOB_ID, value); }
        }
		
        [DataMember]
        public string AppNo
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_APP_NO)); }
            set { SetData(SalesAppTable.C_APP_NO, value); }
        }
		
        [DataMember]
        public string Type
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_TYPE)); }
            set { SetData(SalesAppTable.C_TYPE, value); }
        }
		
        [DataMember]
        public string SoNo
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_SO_NO)); }
            set { SetData(SalesAppTable.C_SO_NO, value); }
        }
		
        [DataMember]
        public string CustomerId
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_CUSTOMER_ID)); }
            set { SetData(SalesAppTable.C_CUSTOMER_ID, value); }
        }
		
        [DataMember]
        public string CustomerName
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_CUSTOMER_NAME)); }
            set { SetData(SalesAppTable.C_CUSTOMER_NAME, value); }
        }
		
        [DataMember]
        public string CustomerCode
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_CUSTOMER_CODE)); }
            set { SetData(SalesAppTable.C_CUSTOMER_CODE, value); }
        }
		
        [DataMember]
        public string ContactPerson
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_CONTACT_PERSON)); }
            set { SetData(SalesAppTable.C_CONTACT_PERSON, value); }
        }
		
        [DataMember]
        public string AppPerson
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_APP_PERSON)); }
            set { SetData(SalesAppTable.C_APP_PERSON, value); }
        }
		
        [DataMember]
        public DateTime AppDate
        {
            get { return Convert.ToDateTime(GetData(SalesAppTable.C_APP_DATE)); }
            set { SetData(SalesAppTable.C_APP_DATE, value); }
        }
		
        [DataMember]
        public string PaymentType
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_PAYMENT_TYPE)); }
            set { SetData(SalesAppTable.C_PAYMENT_TYPE, value); }
        }
		
        [DataMember]
        public string DeliveryAdd
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_DELIVERY_ADD)); }
            set { SetData(SalesAppTable.C_DELIVERY_ADD, value); }
        }
		
        [DataMember]
        public string DeliveryPc
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_DELIVERY_PC)); }
            set { SetData(SalesAppTable.C_DELIVERY_PC, value); }
        }
		
        [DataMember]
        public string TrasportType
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_TRASPORT_TYPE)); }
            set { SetData(SalesAppTable.C_TRASPORT_TYPE, value); }
        }
		
        [DataMember]
        public string DeliveryType
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_DELIVERY_TYPE)); }
            set { SetData(SalesAppTable.C_DELIVERY_TYPE, value); }
        }
		
        [DataMember]
        public decimal TotalAmount
        {
            get { return Convert.ToDecimal(GetData(SalesAppTable.C_TOTAL_AMOUNT)); }
            set { SetData(SalesAppTable.C_TOTAL_AMOUNT, value); }
        }
		
        [DataMember]
        public string Currency
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_CURRENCY)); }
            set { SetData(SalesAppTable.C_CURRENCY, value); }
        }
		
        [DataMember]
        public string Remark
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_REMARK)); }
            set { SetData(SalesAppTable.C_REMARK, value); }
        }
		
        [DataMember]
        public string Status
        {
            get { return Convert.ToString(GetData(SalesAppTable.C_STATUS)); }
            set { SetData(SalesAppTable.C_STATUS, value); }
        }
		
		#endregion
	}
	
	
}	

